<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>技能交换 - 社交圈</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #10b981;
            --primary-light: #34d399;
            --primary-dark: #059669;
            --secondary: #6366f1;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --border-light: #e2e8f0;
            --radius: 12px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        .nav-action.primary {
            color: var(--primary);
        }
        
        /* 搜索和筛选区 */
        .search-filter {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-box {
            position: relative;
            margin-bottom: 12px;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 30px;
            border: 1px solid var(--border-light);
            font-size: 0.9rem;
            background-color: var(--bg-light);
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary-light);
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
        }
        
        /* 技能分类筛选 */
        .category-filter {
            overflow-x: auto;
            padding-bottom: 4px;
            -webkit-overflow-scrolling: touch;
        }
        
        .category-list {
            display: flex;
            gap: 10px;
            width: max-content;
        }
        
        .category-item {
            padding: 6px 16px;
            background-color: var(--bg-light);
            border-radius: 20px;
            font-size: 0.85rem;
            white-space: nowrap;
            color: var(--text-primary);
            border: 1px solid var(--border-light);
        }
        
        .category-item.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 列表筛选工具栏 */
        .list-toolbar {
            padding: 10px 16px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
        }
        
        .toolbar-title {
            font-size: 0.9rem;
            font-weight: 600;
        }
        
        .view-options {
            display: flex;
            gap: 12px;
        }
        
        .view-option {
            color: var(--text-secondary);
            font-size: 1rem;
        }
        
        .view-option.active {
            color: var(--primary);
        }
        
        /* 技能交换列表 */
        .exchange-list {
            padding: 12px 16px;
        }
        
        /* 技能卡片基础样式 */
        .skill-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            margin-bottom: 14px;
            box-shadow: var(--shadow);
            overflow: hidden;
            border: 1px solid var(--border-light);
            transition: transform 0.2s ease;
        }
        
        .skill-card:hover {
            transform: translateY(-2px);
        }
        
        /* 卡片头部 */
        .card-header {
            padding: 14px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-light);
        }
        
        .user-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .user-avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .avatar-placeholder {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background-color: var(--bg-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: var(--text-secondary);
        }
        
        .user-details {
            min-width: 0;
        }
        
        .user-name {
            font-weight: 600;
            font-size: 0.95rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .user-meta {
            font-size: 0.75rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        /* 卡片内容 */
        .card-content {
            padding: 14px 16px;
        }
        
        .skill-title {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 8px;
            color: var(--text-primary);
        }
        
        .skill-description {
            font-size: 0.85rem;
            line-height: 1.5;
            color: var(--text-secondary);
            margin-bottom: 12px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        /* 技能标签区域 */
        .skills-exchange {
            display: flex;
            margin-bottom: 12px;
            gap: 10px;
            align-items: center;
        }
        
        .skill-offer, .skill-seek {
            flex: 1;
        }
        
        .skill-label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            margin-bottom: 4px;
            display: block;
        }
        
        .skill-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        
        .skill-tag {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.75rem;
            white-space: nowrap;
        }
        
        .offer-tag {
            background-color: rgba(16, 185, 129, 0.1);
            color: var(--primary);
            border: 1px solid rgba(16, 185, 129, 0.2);
        }
        
        .seek-tag {
            background-color: rgba(99, 102, 241, 0.1);
            color: var(--secondary);
            border: 1px solid rgba(99, 102, 241, 0.2);
        }
        
        .exchange-icon {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        /* 图片区域 - 多图样式 */
        .media-container {
            margin: 12px 0;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .media-single {
            height: 180px;
        }
        
        .media-multiple {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
        }
        
        .media-item {
            aspect-ratio: 1;
            overflow: hidden;
        }
        
        .media-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 无图样式 */
        .no-media .media-container {
            display: none;
        }
        
        /* 卡片底部操作区 */
        .card-actions {
            padding: 10px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid var(--border-light);
        }
        
        .action-stats {
            display: flex;
            gap: 16px;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .contact-btn {
            padding: 6px 16px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        /* 加载更多 */
        .load-more {
            padding: 15px 0;
            text-align: center;
            font-size: 0.9rem;
            color: var(--primary);
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            gap: 4px;
            flex: 1;
            height: 100%;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 1.2rem;
        }
        
        /* 浮动按钮 */
        .float-btn {
            position: fixed;
            right: 20px;
            bottom: 80px;
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
            z-index: 999;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">技能交换</div>
        <button class="nav-action primary" id="filterBtn">
            <i class="fas fa-filter"></i>
        </button>
    </div>
    
    <!-- 搜索和筛选区 -->
    <div class="search-filter">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索技能或用户名...">
        </div>
        
        <div class="category-filter">
            <div class="category-list">
                <div class="category-item active">全部技能</div>
                <div class="category-item">语言学习</div>
                <div class="category-item">艺术创作</div>
                <div class="category-item">运动健身</div>
                <div class="category-item">数码科技</div>
                <div class="category-item">美食烹饪</div>
                <div class="category-item">手工制作</div>
                <div class="category-item">职场技能</div>
                <div class="category-item">生活技巧</div>
            </div>
        </div>
    </div>
    
    <!-- 列表筛选工具栏 -->
    <div class="list-toolbar">
        <div class="toolbar-title">找到 24 个技能交换</div>
        <div class="view-options">
            <div class="view-option active" id="gridView">
                <i class="fas fa-th"></i>
            </div>
            <div class="view-option" id="listView">
                <i class="fas fa-list"></i>
            </div>
        </div>
    </div>
    
    <!-- 技能交换列表 -->
    <div class="exchange-list" id="exchangeContainer">
        <!-- 1. 多图样式卡片 -->
        <div class="skill-card">
            <div class="card-header">
                <div class="user-info">
                    <img src="https://picsum.photos/id/64/200/200" alt="陈佳琪" class="user-avatar">
                    <div class="user-details">
                        <div class="user-name">陈佳琪</div>
                        <div class="user-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 3.2km</span>
                            <span><i class="fas fa-clock"></i> 今天活跃</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="card-content">
                <h3 class="skill-title">UI设计技能交换摄影技巧</h3>
                
                <p class="skill-description">
                    我是一名UI设计师，有5年工作经验，可以教你UI设计、原型制作和基础设计理论。希望学习摄影技巧，尤其是人像和风光摄影。
                </p>
                
                <div class="skills-exchange">
                    <div class="skill-offer">
                        <span class="skill-label">我能提供</span>
                        <div class="skill-tags">
                            <span class="skill-tag offer-tag">UI设计</span>
                            <span class="skill-tag offer-tag">原型制作</span>
                            <span class="skill-tag offer-tag">设计理论</span>
                        </div>
                    </div>
                    
                    <div class="exchange-icon">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    
                    <div class="skill-seek">
                        <span class="skill-label">我想学习</span>
                        <div class="skill-tags">
                            <span class="skill-tag seek-tag">摄影技巧</span>
                            <span class="skill-tag seek-tag">人像摄影</span>
                            <span class="skill-tag seek-tag">后期修图</span>
                        </div>
                    </div>
                </div>
                
                <div class="media-container media-multiple">
                    <div class="media-item">
                        <img src="https://picsum.photos/id/119/300/300" alt="设计作品1" class="media-image">
                    </div>
                    <div class="media-item">
                        <img src="https://picsum.photos/id/133/300/300" alt="设计作品2" class="media-image">
                    </div>
                    <div class="media-item">
                        <img src="https://picsum.photos/id/142/300/300" alt="设计作品3" class="media-image">
                    </div>
                </div>
            </div>
            
            <div class="card-actions">
                <div class="action-stats">
                    <div class="stat-item">
                        <i class="far fa-eye"></i>
                        <span>128</span>
                    </div>
                    <div class="stat-item">
                        <i class="far fa-comment"></i>
                        <span>24</span>
                    </div>
                </div>
                <button class="contact-btn" data-user="陈佳琪">
                    <i class="fas fa-comment"></i> 联系TA
                </button>
            </div>
        </div>
        
        <!-- 2. 单图样式卡片 -->
        <div class="skill-card">
            <div class="card-header">
                <div class="user-info">
                    <img src="https://picsum.photos/id/91/200/200" alt="李明" class="user-avatar">
                    <div class="user-details">
                        <div class="user-name">李明</div>
                        <div class="user-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 5.7km</span>
                            <span><i class="fas fa-clock"></i> 3天前活跃</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="card-content">
                <h3 class="skill-title">专业摄影换英语口语练习</h3>
                
                <p class="skill-description">
                    专业摄影师，8年经验，擅长各种摄影技巧和后期处理。想提高英语口语能力，希望能和母语为英语的朋友交流，或有良好英语水平的伙伴。
                </p>
                
                <div class="skills-exchange">
                    <div class="skill-offer">
                        <span class="skill-label">我能提供</span>
                        <div class="skill-tags">
                            <span class="skill-tag offer-tag">摄影教学</span>
                            <span class="skill-tag offer-tag">后期处理</span>
                            <span class="skill-tag offer-tag">器材选择</span>
                        </div>
                    </div>
                    
                    <div class="exchange-icon">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    
                    <div class="skill-seek">
                        <span class="skill-label">我想学习</span>
                        <div class="skill-tags">
                            <span class="skill-tag seek-tag">英语口语</span>
                            <span class="skill-tag seek-tag">日常对话</span>
                        </div>
                    </div>
                </div>
                
                <div class="media-container media-single">
                    <img src="https://picsum.photos/id/239/600/400" alt="摄影作品" class="media-image" style="width: 100%; height: 100%;">
                </div>
            </div>
            
            <div class="card-actions">
                <div class="action-stats">
                    <div class="stat-item">
                        <i class="far fa-eye"></i>
                        <span>96</span>
                    </div>
                    <div class="stat-item">
                        <i class="far fa-comment"></i>
                        <span>18</span>
                    </div>
                </div>
                <button class="contact-btn" data-user="李明">
                    <i class="fas fa-comment"></i> 联系TA
                </button>
            </div>
        </div>
        
        <!-- 3. 无图样式卡片 -->
        <div class="skill-card no-media">
            <div class="card-header">
                <div class="user-info">
                    <div class="avatar-placeholder">
                        <i class="fas fa-user"></i>
                    </div>
                    <div class="user-details">
                        <div class="user-name">王建国</div>
                        <div class="user-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 8.3km</span>
                            <span><i class="fas fa-clock"></i> 1天前活跃</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="card-content">
                <h3 class="skill-title">编程技能换钢琴入门教学</h3>
                
                <p class="skill-description">
                    软件工程师，精通Python、JavaScript等编程语言，可教授编程入门和网页开发。一直想学习钢琴，希望找到能教钢琴基础的朋友。
                </p>
                
                <div class="skills-exchange">
                    <div class="skill-offer">
                        <span class="skill-label">我能提供</span>
                        <div class="skill-tags">
                            <span class="skill-tag offer-tag">Python</span>
                            <span class="skill-tag offer-tag">JavaScript</span>
                            <span class="skill-tag offer-tag">网页开发</span>
                        </div>
                    </div>
                    
                    <div class="exchange-icon">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    
                    <div class="skill-seek">
                        <span class="skill-label">我想学习</span>
                        <div class="skill-tags">
                            <span class="skill-tag seek-tag">钢琴入门</span>
                            <span class="skill-tag seek-tag">乐理基础</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="card-actions">
                <div class="action-stats">
                    <div class="stat-item">
                        <i class="far fa-eye"></i>
                        <span>74</span>
                    </div>
                    <div class="stat-item">
                        <i class="far fa-comment"></i>
                        <span>12</span>
                    </div>
                </div>
                <button class="contact-btn" data-user="王建国">
                    <i class="fas fa-comment"></i> 联系TA
                </button>
            </div>
        </div>
        
        <!-- 4. 烹饪技能交换卡片 -->
        <div class="skill-card no-media">
            <div class="card-header">
                <div class="user-info">
                    <img src="https://picsum.photos/id/65/200/200" alt="张婷" class="user-avatar">
                    <div class="user-details">
                        <div class="user-name">张婷</div>
                        <div class="user-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 2.1km</span>
                            <span><i class="fas fa-clock"></i> 今天活跃</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="card-content">
                <h3 class="skill-title">中式烹饪换烘焙技巧</h3>
                
                <p class="skill-description">
                    擅长中式家常菜和川菜烹饪，可教你做出美味的家常菜。想学习西式烘焙，特别是蛋糕和面包的制作方法，希望能互相学习。
                </p>
                
                <div class="skills-exchange">
                    <div class="skill-offer">
                        <span class="skill-label">我能提供</span>
                        <div class="skill-tags">
                            <span class="skill-tag offer-tag">中式烹饪</span>
                            <span class="skill-tag offer-tag">川菜</span>
                            <span class="skill-tag offer-tag">家常菜</span>
                        </div>
                    </div>
                    
                    <div class="exchange-icon">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    
                    <div class="skill-seek">
                        <span class="skill-label">我想学习</span>
                        <div class="skill-tags">
                            <span class="skill-tag seek-tag">烘焙</span>
                            <span class="skill-tag seek-tag">蛋糕制作</span>
                            <span class="skill-tag seek-tag">面包制作</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="card-actions">
                <div class="action-stats">
                    <div class="stat-item">
                        <i class="far fa-eye"></i>
                        <span>156</span>
                    </div>
                    <div class="stat-item">
                        <i class="far fa-comment"></i>
                        <span>32</span>
                    </div>
                </div>
                <button class="contact-btn" data-user="张婷">
                    <i class="fas fa-comment"></i> 联系TA
                </button>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="load-more" id="loadMore">
            <span>加载更多技能交换</span>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <div class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </div>
        <div class="nav-item active">
            <i class="fas fa-exchange-alt nav-icon"></i>
            <span>技能交换</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </div>
    </div>
    
    <!-- 发布新技能交换的浮动按钮 -->
    <div class="float-btn" id="createBtn">
        <i class="fas fa-plus"></i>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 技能分类筛选
        document.querySelectorAll('.category-item').forEach(item => {
            item.addEventListener('click', function() {
                document.querySelectorAll('.category-item').forEach(i => i.classList.remove('active'));
                this.classList.add('active');
                showToast(`已筛选：${this.textContent}`);
            });
        });
        
        // 视图切换
        document.getElementById('gridView').addEventListener('click', function() {
            document.querySelectorAll('.view-option').forEach(opt => opt.classList.remove('active'));
            this.classList.add('active');
            document.getElementById('exchangeContainer').style.padding = '12px 16px';
            showToast('网格视图');
        });
        
        document.getElementById('listView').addEventListener('click', function() {
            document.querySelectorAll('.view-option').forEach(opt => opt.classList.remove('active'));
            this.classList.add('active');
            document.getElementById('exchangeContainer').style.padding = '8px 0';
            showToast('列表视图');
        });
        
        // 联系按钮
        document.querySelectorAll('.contact-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const userName = this.getAttribute('data-user');
                showToast(`打开与${userName}的聊天窗口`);
            });
        });
        
        // 发布新技能交换
        document.getElementById('createBtn').addEventListener('click', function() {
            showToast('发布新的技能交换');
        });
        
        // 筛选按钮
        document.getElementById('filterBtn').addEventListener('click', function() {
            showToast('打开高级筛选');
        });
        
        // 返回按钮
        document.getElementById('backBtn').addEventListener('click', function() {
            history.back();
        });
        
        // 加载更多
        document.getElementById('loadMore').addEventListener('click', function() {
            this.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 加载中...';
            
            // 模拟加载延迟
            setTimeout(() => {
                this.innerHTML = '<span>加载更多技能交换</span>';
                showToast('已加载全部内容');
            }, 1500);
        });
        
        // 提示消息功能
        function showToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.classList.add('show');
            
            setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
    </script>
</body>
</html>

